home *** CD-ROM | disk | FTP | other *** search
- Path: news.cern.ch!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c
- Subject: Re: dos.h equivalent in gcc or cc ?
- Date: 18 Apr 96 17:04:39 GMT
- Organization: CERN European Lab for Particle Physics
- Distribution: inet
- Message-ID: <danpop.829847079@news.cern.ch>
- References: <3173B701.41C6@ieec.fcr.es> <4l5jcr$de1@news.interpath.net>
- NNTP-Posting-Host: ues5.cern.ch
- Mime-Version: 1.0
- Content-Type: text/plain; charset=US-ASCII
- Content-Transfer-Encoding: 7bit
- X-Newsreader: NN version 6.5.0 #18 (NOV)
-
- In <4l5jcr$de1@news.interpath.net> softbase@mercury.interpath.com (Scott McMahan - Softbase Systems) writes:
-
- >Oscar Chic (chic@ieec.fcr.es) wrote:
- >: I'm trying to pass arguments to a function with _argv and _argc
- >: global variables that Borland 4.5 permits.
- >: In Borland you must do an include of dos.h
- >: Which is the equivalent in gcc or cc in a UNIX WS ?
- >: Which file must I include to do the same ?
- >
- >This sounds like someone has been bitten by non-standard,
- >non-portable usage. It's generally easy to work around things
- >like this and bzero() using tricks.
- >
- >Just declare them and then make them have the same values as
- >were passed in through the correct variables.
- >
- >-*-
- >
- >int _argc;
- >char **_argv;
- >
- >int main(int argc, char **argv) {
- >
- > _argv = argv; _argc = argc;
- >}
-
- You forgot a small detail:
-
- ANSI classic 4.1.2: All external identifiers that begin with an underscore
- are reserved.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-